<template>
	<view class="container">
		<view class="ver-layout-center user-info-layout">
			<image class="user-icon" :src="mpUserInfo.avatarUrl||mpUserInfo.avatar"></image>
			<view style="margin-top: 10px;">性别：{{(mpUserInfo.gender==1||mpUserInfo.gender=="m")?"男":"女"}}</view>
			<view>昵称：{{mpUserInfo.nickName}}</view>
			<view>国家：{{mpUserInfo.country||mpUserInfo.countryCode}}</view>
			<view>省份：{{mpUserInfo.province}}</view>
			<view>城市：{{mpUserInfo.city}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mpUserInfo: {}
			}
		},
		onLoad(options) {
			let userObj = JSON.parse(options.userObj)
			let userInfo = uni.getStorageSync("userInfo");
			console.log("userInfo", userInfo)
			if (userObj.tag === "微信小程序") {
				this.mpUserInfo = userInfo.wxUserInfo
			} else {
				this.mpUserInfo = userInfo.aliUserInfo
			}
		},
		methods: {

		}
	}
</script>

<style>
	page {
		background: #F4F4FA;
	}

	.user-icon {
		width: 110rpx;
		height: 110rpx;
		border-radius: 50%;
	}

	.user-info-layout {
		width: 70%;
		margin: auto;
		color: white;
		padding: 20px;
		margin-top: 30px;
		font-size: small;
		background: #9cabca;
		border-radius: 8px;
	}
</style>
